package com.raymond.smgp.codec.decoding;

import com.raymond.client.codec.decoding.BaseDecoder;
import com.raymond.client.msg.BaseAgreement;
import com.raymond.cmpp.codec.annotation.MsgCodec;
import com.raymond.cmpp.enums.CommandIdType;
import com.raymond.cmpp.msg.response.TerminateResponseMessage;
import io.netty.channel.ChannelHandlerContext;

import java.util.List;

/**
 * 连接拆除响应解码
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-08-05 15:56
 */
@MsgCodec(commandId = CommandIdType.TERMINATE_RESPONSE)
public class TerminateResponseMessageDecoder extends BaseDecoder {
    @Override
    public void decode(ChannelHandlerContext ctx, BaseAgreement msg, List<Object> out) throws Exception {
        out.add(new TerminateResponseMessage(msg.getSequenceId()));
    }
}
